if ~exists("pfiles:SuperTags.cfg") then do;a="cfSuperTags c9NOT caConfigured!";logentry a;tr a;exit;end
call open(f1,"pfiles:SuperTags.cfg","r");a=readln(f1);parse var a cver""j;dfp=readln(f1);dfd=readln(f1);call close(f1)
if ver~=cver then do;a="c9Wrong SuperTags Config Version!";tr a;logentry a;exit;end
if sc=1 then do;a="c9SuperTags Temporarily Disabled";tr a;logentry a;exit;end
list.="";nlist.="";nlists=0;if ~exists(dfp"TagLines") then do;a="No tag lists created; SuperTags automaint finished!";tr a;logentry a;exit;end
call open(f1,dfp"TagLines","r");do i=1 until eof(f1);list.i=readln(f1);parse var list.i fn.i""ln.i""ag.i""ge.i""ya.i""um.i""nf.i""j;end i;call close(f1);lists=i-1
do i=1 to lists;if exists(dfd||fn.i".new") then do;nlists=nlists+1;nlist.nlists=fn.i;end;end i
if nlists=0 then do;a="No new tags to process; SuperTags automaint finished!";tr a;logentry a;exit;end
a="SuperTags automaint started";tr a;tr;logentry a;do ii=1 to nlists;se "@4Reading new tags from `"nlist.ii".new'..."
call open(f1,dfd||nlist.ii".new","r");do ij=1 until eof(f1);ntag.ij=readln(f1);end ij;ntags=ij-1;call close(f1);tr "done."
se "Appending them to `"nlist.ii"' list...";call open(f1,dfd||nlist.ii,"a");do ij=1 to ntags;call writeln(f1,ntag.ij);end ij;call close(f1);tr "done."